#include <stdio.h>
#define N 40
int ReadScore(int score[],int num[])
{
    int i=-1;
    do{
        i++;
        printf("please input the score and ID of No.%d student:",i+1);
        scanf("%d,%d",&score[i],&num[i]);
    }while(score[i]>=0&&num[i]>=0);
    return i;
}
int FindMax(int score[],int n)
{
    int i,max;
    max=0;
    for(i=0;i<n;i++)
    {
        if(score[i]>score[max])
            max=i;
    }
    return max;
}
void main()
{
    int score[N],num[N],n;
    n=ReadScore(score,num);
    printf("the ID of the student who gets the highest mark is %d\n",num[FindMax(score,n)]);
    printf("And the mark is %d",score[FindMax(score,n)]);
}
